$OpenBSD: patch-arpreqtest_c,v 1.3 2013/12/06 11:53:05 jca Exp $
--- arpreqtest.c.orig	Tue Apr 18 04:04:24 2000
+++ arpreqtest.c	Fri Dec  6 12:47:49 2013
@@ -20,7 +20,7 @@ int arp_request(HDEV fd, char *ether_addr, char *targe
   unsigned long sourceIP, destIP;
   struct result *resPtr;
 #if defined(_OpenBSD_)
-  char *defaultdevice = "ep1";
+  static char *defaultdevice = NULL;
 #else if defined(SOLARIS)
   char *defaultdevice = "le0";
 #endif
@@ -33,7 +33,9 @@ int arp_request(HDEV fd, char *ether_addr, char *targe
   pid_t our_id;
   caddr_t area;
 
-
+  if (!defaultdevice) {
+    defaultdevice = strdup(pcap_lookupdev(NULL));
+  }
 #ifdef SOLARIS
   mfd = open("/dev/zero", O_RDWR);
   if (mfd < 0){
